﻿<?php
// ------------------------------------------------------------------
// NEEDED STUBS FOR THIS EXAMPLE
// ------------------------------------------------------------------


// this will include all needed files to be able to build a Request
include_once($CONF["STUBS_FOLDER"]."Map24Routing/Map24Routing.php5");


// ------------------------------------------------------------------
// NEEDED PARAMETERS FOR THIS REQUEST
// ------------------------------------------------------------------


// the start address (coordinates)
$sLongitude = '521.0196';
$sLatitude 	= '3006.554';

$TravelTime = 300;
$TravelDistance = 2000;

// show the Isoline on the map
$proIdx=0;
$property[$proIdx]= new Property();
$property[$proIdx]->Key = "SynchronizeClient";
$property[$proIdx]->Value = "TRUE";


// ------------------------------------------------------------------
// BUILDING THE REQUEST
// ------------------------------------------------------------------


// definition of the request header with Map24ID and SessionID
$header = new RequestHeader();
$header->Map24ID  = $CONF['MAP24_ID'];
$header->ClientID = $CONF['SESSION_ID'];

// definition of the request body
$request = new CalculateRoutesIsolineRequest();

// define the Start Address
$request->Start = new Coordinate();
$request->Start->Longitude = $sLongitude;
$request->Start->Latitude = $sLatitude;

// define the TravelTime
$request->TravelTime=$TravelTime;
$request->TravelDistance=$TravelDistance;

// define the Properties
if(is_array($property)) { $request->Properties = $property; }


// ------------------------------------------------------------------
// EXECUTE THE REQUEST
// ------------------------------------------------------------------


// in this object the SoapClient will be initiated and executed
$routing = new Map24Routing($CONF['MAPTP_SYSTEM'],$CONF['MAP24_ID'],$CONF['SESSION_ID']);
$response = $routing->calculateRoutesIsoline($header,$request);


// ------------------------------------------------------------------
// OUTPUT THE RESULT
// ------------------------------------------------------------------


$resultString = "";
$counter = 0;


?>